package com.fang.shirotestnoredis.controller;

import com.fang.shirotestnoredis.common.ServerResponse;
import io.swagger.annotations.ApiOperation;
import org.apache.shiro.authz.annotation.RequiresAuthentication;
import org.apache.shiro.authz.annotation.RequiresRoles;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author Bernie_xin
 * @create 2021/1/8 20:01
 **/
@RestController
@RequestMapping("/mytest")
public class TestController {


    @PostMapping("/test")
    @RequiresRoles("root")
    // @ApiOperation(value = "用户登录",response = ServerResponse.class,httpMethod = "POST")
    public String test(){
        return "OK";
    }

    //用户登录
    @PostMapping("/test2")
    @RequiresAuthentication
    // @ApiOperation(value = "用户登录",response = ServerResponse.class,httpMethod = "POST")
    public String test2(){
        return "OK test2";
    }


}
